Skip to content

fix: logger.warn() warning & test_output_vex test (#1691) #1692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 9, 2022
Merged

fix: logger.warn() warning & test_output_vex test (#1691) #1692

merged 4 commits into from
Jun 9, 2022

Conversation

M-Faheem-Khan
Copy link
Contributor

  • Fixed Fix warning about LOGGER.warn() #1691 by replace the depreciated warn method with warning.
  • Fixed the ResourceWarning in test_output_vex test. The following warning was printed because the test file was only being opened in default 'r' mode but was never closed.

The test was run using python3 setup.py test

test_output_vex (test.test_output_engine.TestOutputEngine)
Test creating VEX formatted file ... /workspaces/cve-bin-tool/test/test_output_engine.py:685: ResourceWarning:

unclosed file <_io.TextIOWrapper name='test.vex' mode='r' encoding='UTF-8'>

@b31ngd3v
Copy link
Contributor

b31ngd3v commented Jun 8, 2022

hi @M-Faheem-Khan the PR title isn't following conventional commit rules, can you change its title to fix: logger.warn() warning & test_output_vex test
and if you want to learn more, visit https://www.conventionalcommits.org/en/v1.0.0/.

@M-Faheem-Khan M-Faheem-Khan changed the title Fixed logger.warn() warning & test_output_vex test fix: logger.warn() warning & test_output_vex test Jun 8, 2022
@terriko
Copy link
Contributor

terriko commented Jun 8, 2022

Thank you! I've approved the workflow so the tests can run now.

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2022

Codecov Report

Merging #1692 (01574d6) into main (08b9a6f) will decrease coverage by 2.66%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1692      +/-   ##
==========================================
- Coverage   81.27%   78.60%   -2.67%     
==========================================
  Files         298      298              
  Lines        6188     6189       +1     
  Branches     1006     1006              
==========================================
- Hits         5029     4865     -164     
- Misses        950     1105     +155     
- Partials      209      219      +10     
Flag Coverage Δ
longtests 78.60% <100.00%> (-2.67%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cve_bin_tool/output_engine/__init__.py 58.37% <100.00%> (ø)
test/test_output_engine.py 94.91% <100.00%> (+0.02%) ⬆️
test/test_cvedb.py 58.53% <0.00%> (-34.15%) ⬇️
cve_bin_tool/checkers/xml2.py 61.36% <0.00%> (-27.28%) ⬇️
test/test_available_fix.py 76.47% <0.00%> (-23.53%) ⬇️
test/test_json.py 70.00% <0.00%> (-20.00%) ⬇️
cve_bin_tool/cvedb.py 72.52% <0.00%> (-12.38%) ⬇️
test/test_scanner.py 62.30% <0.00%> (-12.31%) ⬇️
test/test_cli.py 81.39% <0.00%> (-9.31%) ⬇️
cve_bin_tool/available_fix/redhat_cve_tracker.py 71.42% <0.00%> (-8.93%) ⬇️
... and 6 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@M-Faheem-Khan M-Faheem-Khan changed the title fix: logger.warn() warning & test_output_vex test fix: logger.warn() warning & test_output_vex test (#1691) Jun 9, 2022
@M-Faheem-Khan
Copy link
Contributor Author

@terriko can you approve the workflow once again? :)

Changes:

  • Rename the Pull Request title following ConventionalCommits
  • Apply pyupgrade change
    • remove explicit file open mode (the default mode is 'r' and the open() was explicitly setting the open mode to 'r')

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@terriko terriko merged commit 09ebae5 into intel:main Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix warning about LOGGER.warn()
4 participants